package com.springboot.study.config;

import com.springboot.study.entity.UserEntity;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: guodong
 * @Date: 2021/4/27 13:35
 * @Version: 1.0
 * @Description: 初始化bean 主要是完成初始化一些流程  比如赋值、
 */
@Component
@Import({UserEntity.class})
public class InitDataService implements InitializingBean {

    public static final Map<String, String> data  = new HashMap<>();

    @Override
    public void afterPropertiesSet() throws Exception {
        for(int i = 1; i < 10; i++){
            data.put(String.valueOf(i), String.valueOf(i));
        }
    }


}
